package com.zyz.A_程序基础.B_运算.整数;

/**
 * @author: vick
 * @Date: 2025/3/10
 * @Description:
 * @version: 1.0
 */
public class Demo5 {
    public static void main(String[] args) {
        //二进制
        int a = 7; //0111    0+ 1*2^2  + 1 * 2^1 + 1*2^0 = 7

        //左移位 变大了
        int a1 = a << 1; //14
        int a2 = a << 2; //28
        System.out.println(a1);
        System.out.println(a2);

        //右移位  变小了
        int a3 = a >>1; //3
        int a4 = a >>2; //1
        System.out.println(a3);
        System.out.println(a4);
    }
}
